/**
 * 
 */
package soa.security.mgr.service;

import java.util.List;
import java.util.Map;

import soa.security.domain.Organization;
import soa.security.exception.AdapterException;
import soa.security.exception.OrganizationException;
import soa.security.mgr.service.base.BaseMgrService;
import soa.security.ws.base.ModelAdapter;

/**
 * @author CreGu
 *
 */
public interface OrganizationMgrService extends BaseMgrService,
		ModelAdapter<Organization> {
	List<Organization> adapt(String xml) throws AdapterException;

	/**
	 * 机构entry，初始化账号，岗位，组，角色的分组
	 * 
	 * @param organization
	 *            void
	 * 
	 * @author Cre.Gu at 2015年4月12日
	 */
	void initEntryUnits(Organization organization);

	void addSubOrganization(String organizationId, Organization a)
			throws OrganizationException;

	void updateOrganization(Organization a) throws OrganizationException;

	List<Organization> allSubOrganizations(String organizationId)
			throws OrganizationException;

	List<Organization> allSubOrganizations(String organizationId,
			Map<String, Object> parameters) throws OrganizationException;

	List<Organization> allOrganizations(String baseDn)
			throws OrganizationException;

	List<Organization> allOrganizations(String baseDn,
			Map<String, Object> parameters) throws OrganizationException;

	List<Organization> allOrganizations4Login() throws OrganizationException;

	List<Organization> getOrganization(String organizationId)
			throws OrganizationException;

	void addOrganization(String regionDn, Organization organization)
			throws OrganizationException;

	void backUpOrganization() throws OrganizationException;

	Organization findByDn(String dn) throws OrganizationException;

	boolean deleteByDn(String dn) throws OrganizationException;
	
	public Organization existByCode(String code);
	public Organization existByOrganizationCode(String organizationCode);

}
